<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">

<title>用户注册</title>
<link href="css/shoppingCarAndMyCustom.css" type="text/css" rel="stylesheet" />
<link href="css/login.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="js/jquery-1.7.2.js"></script>
<script type="text/javascript" src="js/login.js"></script>

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
<script type="text/javascript" src="js/jquery-1.7.2.js"></script>
</head>
<script type="text/javascript">
   var reg = /^(\w){2,15}$/;
   var xin=false;
   var yuan=false;
   var qcon=false;
   
   function yanyuan(){
     var yuanpass=document.getElementById("yuanpwd").value;
     var hidden=document.getElementById("hid").value;
     var yuanfont=document.getElementById("yuanfont");
    $.post(
     "confirmpwd.action",
     {yuanpwd:yuanpass,id:hidden},
    function yu(data){
     if(yuanpass!=""&&yuanpass!=null){
      if(data.str=="false"){
           yuanfont.innerHTML="原密码输入错误";
           }else{
            yuan=true;
         yuanfont.innerHTML="";
         }
        
      }
      else{
        yuanfont.innerHTML="原密码不能为空";
      }
      },
      "json"
      );
     }
     
     
     function yanxin(){
     var xinpass=document.getElementById("xinpwd").value;
     var xinfont=document.getElementById("xinfont");
     if(xinpass!=""&&xinpass!=null){
         if(reg.test(xinpass)){
            xin=true;
            xinfont.innerHTML="";
         }
         else{
          xinfont.innerHTML="长度要在2-15位之间";
         }
      }
      else{
        xinfont.innerHTML="密码不能为空";
      }

      }
     
     function yancon(){
       var pass=document.getElementById("xinpwd").value;
       var con=document.getElementById("conpwd").value;
        var confont=document.getElementById("confont");
        if(con!=""&&con!=null) {
         if(con==pass) {
            qcon=true;
          confont.innerHTML="";
      }else{
         confont.innerHTML="确认密码跟新密码不同，请重新输入";
      }
      }
      else{
          confont.innerHTML="确认密码不能为空";
      }
     }
     
    function que(){
    
      if(xin==true&&yuan==true&&qcon==true){
        return true;
      }
      else{
      alert("完整输入信息");
      return false;
      }
      
    }
  </script>


<body>
<div style="background-color:rgb(102,102,102); width:100%;">
	<div class="head" id="head">
    	<div id="webbei_logol">
        	<img src="img/logo.gif"/>
        </div>
        <div class="usercando">
        	<div class="usercando_dingzhi">
            	<a href=""><img src="img/head_custom.gif"/></a>
            </div>
            <div class="usercando_share">
            	<a href=""><img src="img/head_share.gif"/></a>
            </div>
        </div>
        <div class="search" id="search">
        	<div style="width:100%; height:45px;">
            </div>
            <div style="padding-top:0px;">
            	<div style="float:left;">
        		<input type="text" value="" id="searchsomething" /></div>
                <div style="float:left;">
            	<a href=""><img src="img/head_search_bt.gif"/></a></div>
            </div>
        </div>
        <div class="something_else">
        	<div class="something_else_up">
            	<div style="width:120px; float:left; padding-top:7px;">
            		&nbsp;&nbsp;&nbsp;<a href="">转</a>
                	&nbsp;<a href="">加关注</a>
                </div>
                <div style="width:100px; float:left; padding-top:2px; padding-left: 10px;">
                	<a href=""><img src="img/login_txwb.png"/></a>
                	<a href=""><img src="img/login_rr.png"/></a>
                	<a href=""><img src="img/login_db.png"/></a>
                </div>
            </div>
            <div class="something_else_down">
            	<div style="width:125px; float:left; padding-top:5px; padding-left:10px;">
                	<div style="float:left;">
                		<img src="img/head_cart.gif"/>
                    </div>
                    <div style="float:left; height:20px; padding-top:5px;">
                    	&nbsp;购物车(<a href="">2</a>)
                    </div>
                </div>
                <div class="loginandresign">
                	<div id="login_btn" style="float:left; cursor:pointer;">登陆</div>
                    <div id="resign_btn" style="float:left; cursor:pointer;">|注册</div>
                    <div id="login_level">
                		<div class="login_level_email">
    						邮箱：<input type="text" id="email" />
    					</div>
    					<div class="login_level_email">
    						密码：<input type="text" id="pwd" />
    					</div>
    					<div class="remember_pwd">
    						<input type="checkbox" id="checkbox" />
        					记住密码&nbsp;&nbsp;<a href="">忘记密码？</a>
    					</div>
    					<div class="more_loginway">
    						<img src="img/login_qq.png"/>
        					<img src="img/tianya.png"/>
       				 		<img src="img/twitter.png"/>
        					<img src="img/tuita.png"/>
        					<img src="img/msn.png" />
        					<img src="img/souhuweibo.png"/>
        					<img src="img/qiyiqitan.png"/>
        					<img src="img/more.png" id="moreway"/>
    					</div>
             		</div>
                </div>
            </div>
        </div>
    </div>
</div>
<br />
 <form action="updatepwd" method="post" onsubmit="return que();">
<table>
	<tr><td>
		<br /><br />
	</td><td></td><td></td></tr>
	<tr>
		<td width="35%"></td>
		<td align="left" valign="top">
			<table>
	<tr><td>
		<font class="ziti1">密码修改：</font>
	</td></tr>
	<tr><td>
		&nbsp;&nbsp;&nbsp;<font class="ziti2">请输入原密码：</font>
		<input type="text" name="yuanpwd" id="yuanpwd" onblur="yanyuan()">
		<font size="3" color="red" id="yuanfont">*</font>
	</td></tr>
	<tr><td>
		&nbsp;&nbsp;&nbsp;<font class="ziti2">输入新密码：</font>
		<input type="text" name="xinpwd" id="xinpwd" onblur="yanxin()">
		<font size="3" color="red" id="xinfont">*</font>
	</td></tr>
	<tr><td>
		&nbsp;&nbsp;&nbsp;<font class="ziti2">确认新密码：</font>
		<input type="text" name="conpwd" id="conpwd" onblur="yancon()">
		<font size="3" color="red" id="confont">*</font>
	</td></tr>
	<tr><td>
		<input type="hidden" value="${id}" id="hid" name="hid"> 
    	<input type="submit" value="确定" class="updateUser_Button">
	</td></tr>
</table>
		</td>
	</tr>
</table>
</form>
	
</body>
</html>
